package com.csaba.connector.dummy;

import java.util.logging.Logger;

import com.csaba.connector.ServiceException;
import com.csaba.connector.model.Session;
import com.csaba.connector.service.AbstractChangePasswordService;
import com.csaba.util.LoggerHelper;

public class DummyChangePasswordService extends AbstractChangePasswordService
{
	private final static Logger logger = LoggerHelper.getDefaultLogger();

	@Override
	public void execute( final Session session ) throws ServiceException
	{
		if ( !oldPassword.equals(session.getCustomer().getPassword()) )
			throw new ServiceException("Invalid old password.");
		if ( newPassword.equals("1") )
			throw new ServiceException("New password is not enough complex.");

		logger.fine("Dummy: change password is invoked for password type: " + passwordType);
	}

}
